<template>
  <div>
    <!-- :visible.sync="dialogFormVisible" -->
    <el-dialog
      @close="closeFn"
      title="工单详情"
      :visible="dialogVisible"
      width="630px"
      top="120px"
    >
    <el-row  class="title" type="flex" align="center">
  <el-col :span="2">
   <div class="IMg" >
     <img src="" alt="">
   </div>
  </el-col>
  <el-col :span="16" class="cancelTitle" >完成</el-col>
  <el-col :span="6">
   <div>
    <div class="rightImg">
       <img src="https://likede2-admin.itheima.net/img/pic_4.3b5af41c.png" alt="">
    </div>
   </div>
  </el-col>

</el-row>
<el-row type="flex" class="row-bg" justify="center" :gutter="60">
  <el-col :span="11" style="text-align:left">
    <span>设备编号：{{DetailList.innerCode}}</span>
  </el-col>
  <el-col :span="11" style="text-align:left">
    <span>创建日期：{{DetailList.createTime |getNowTime}}</span>
   </el-col>

</el-row>
<el-row type="flex" class="row-bg" justify="center" :gutter="60">
  <el-col :span="11" style="text-align:left">
    <span>完成日期：{{DetailList.updateTime |getNowTime}}</span>
  </el-col>
  <el-col :span="11" style="text-align:left">
    <span>运营人员：{{DetailList.userName}}</span>
   </el-col>

</el-row>
<el-row type="flex" class="row-bg" justify="center" :gutter="60">
  <el-col :span="11" style="text-align:left">
    <span>工单类型：{{DetailList.taskType?.typeId | getTypeId}}</span>
  </el-col>
  <el-col :span="11" style="text-align:left">
    <p>补货数量：<span style="cursor:pointer;color:#6684f8;font-weight:700">补货详情</span>
      </p>
   </el-col>
</el-row>

<el-row type="flex" class="row-bg" justify="center" :gutter="60" >
 <el-col :span="11" style="text-align:left">
     <span>工单方式：{{DetailList.createType=== 0?'自动':DetailList.createType === 1?'手动':'无'}}</span>
  </el-col>
    <el-col :span="11" style="text-align:left">
      <span>  备注：{{DetailList.desc}}</span>
    </el-col>
</el-row>
  <!-- <span slot="footer" class="footer">
   <el-row type="flex" class="row-bg" justify="center">
  <el-col :span="3" style="text-align:left">
    <el-button class="btn" @click="calShow = true">取消工单</el-button>
  </el-col>
</el-row>
  </span> -->
    </el-dialog>
<!-- <CanCal :cancal.sync='calShow' :DetailList='DetailList'   /> -->
  </div>
</template>

<script>
// import CanCal from '@/views/workOrder/components/CanCal.vue'
const dayjs = require('dayjs')
export default {
  props: {
    dialogVisible: Boolean,
    DetailList: {
      type: [Array, Object],
      default: () => {}
    }
  },
  data () {
    return {
      form: {
        innerCode: '',
        productType: '',
        desc: ''
      },
      dialogFormVisible: false,
      formLabelWidth: '400px',
      addShow: false,
      calShow: false
    }
  },
  // components: { CanCal },
  methods: {
    closeFn () {
      this.$emit('update:dialogVisible', false)
    },
    cancelFn () {
      // console.log(this.DetailList.innerCode)
      console.log('取消')
      this.closeFn()
    }
  },
  filters: {
    getNowTime (val) {
      return dayjs(val).format('YYYY-MM-DD HH:mm:ss')
    },
    getAddr (val) {
      const str = val.split('-').pop()
      return str
    },
    getTypeId (val) {
      return !val
        ? '无'
        : val === 1
          ? '投放工单'
          : val === 2
            ? '补货工单'
            : val === 3
              ? '维修工单'
              : val === 4 ? '撤机工单' : '无'
    }
  }
}
</script>

<style lang="less" scoped>
/deep/ .el-dialog {
  border-radius: 15px;
  height: 350px;
  // padding: 0;
}
/deep/.el-form-item__label {
  text-align: right;
  height: 36px;
  line-height: 36px;
  box-sizing: border-box;
}
/deep/ .el-input__inner {
  height: 36px;
  line-height: 36px;
}
/deep/ .cancal {
  width: 80px;
  background-color: #fbf4f1 !important;
  border: none;
}
/deep/ .comfig {
  margin-left: 34px !important;
  width: 80px;
  border: none;
  background: linear-gradient(135deg, #ff9743, #ff5e20) !important;
}
/deep/ .el-dialog__header {
  // box-sizing: border-box;
  padding: 20px 20px 10px;
  height: 20px;
  text-align: left !important;
  font-size: 16px;
  font-weight: 500;
}
/deep/ .el-dialog__body {
  padding: 20px !important;
}
.title {
  background-color: #f8f8f7;
  height: 54px;
  line-height: 54px;
  position: relative;
  margin-bottom: 25px;
.IMg {
  width: 25px;
  height: 25px;
  position: relative;
  img {
    // display: inline-block;
    width: 100%;
    height: 100%;
    // position: absolute;
    padding:13px 0  0 20px;
    // margin-right: 0px;

  }
}
}
.cancelTitle {
  text-align:left;
  padding-left: 16px;
  color: #606266;
}
.rightImg {
  width: 88px;
  height: 68px;
}
/deep/.row-bg {
  height: 36px;
  line-height: 36px;
}
.btn {
  width: 80px;
  height: 36px;
  background-color: #fbf4f0!important;
  border: none;
  color: #655b56!important;
  text-align: center;
  padding-left: 10px;
  color: #fff;
}

/deep/.el-icon-location {
      margin-right: 4px;
    color: #5f84ff;
}

</style>
